import request from '@/utils/request'
import { ObjectType, ResponseDataPromise } from 'typings/interfaces'
import * as proxy from '@/constants/proxy'

export const xmBarRequest = (year): ResponseDataPromise<ObjectType> =>
  request({
    url: proxy.CHECC_API_CMS + `/xmkb/projectOverview/getBarChart?year=${year}`,
    method: 'post',
  })

export const xmLineRequest = (year): ResponseDataPromise<ObjectType> =>
  request({
    url: proxy.CHECC_API_CMS + `/xmkb/projectOverview/getLineDiagram?year=${year}`,
    method: 'post',
  })

export const xmPieRequest = (year: string, level: string): ResponseDataPromise<ObjectType> =>
  request({
    url: proxy.CHECC_API_CMS + `/xmkb/projectOverview/getPieChart?year=${year}&level=${level}`,
    method: 'post',
  })

export const xmTopRequest = (year: string): ResponseDataPromise<ObjectType> =>
  request({
    url: proxy.CHECC_API_CMS + `/xmkb/projectOverview/getTop50?year=${year}`,
    method: 'post',
  })

export const qkStudyRequest = (year: string): ResponseDataPromise<ObjectType> =>
  request({
    url: proxy.CHECC_API_CMS + `/kjsl/strengthShow/getIntellectualProperty?year=${year}`,
    method: 'post',
  })

export const qkYearRequest = (): ResponseDataPromise<ObjectType> =>
  request({
    url: proxy.CHECC_API_CMS + '/kjsl/strengthShow/getProjectYear',
    method: 'post',
  })

export const qkLoopRequest = (year: string): ResponseDataPromise<ObjectType> =>
  request({
    url: proxy.CHECC_API_CMS + `/kjsl/strengthShow/getProjectPerformance?year=${year}`,
    method: 'post',
  })

export const slThesisRequest = (level: string): ResponseDataPromise<ObjectType> =>
  request({
    url: proxy.CHECC_API_CMS + `/kjsl/strengthShow/getTresultAcademicpaper?levelId=${level}`,
    method: 'post',
  })

export const slBzRequest = (level: string): ResponseDataPromise<ObjectType> =>
  request({
    url: proxy.CHECC_API_CMS + `/kjsl/strengthShow/getContributeStandard?levelId=${level}`,
    method: 'post',
  })

export const slGfRequest = (level: string): ResponseDataPromise<ObjectType> =>
  request({
    url: proxy.CHECC_API_CMS + `/kjsl/strengthShow/getContributeTechmethod?levelId=${level}`,
    method: 'post',
  })

export const slJxRequest = (classId: string, gradeId: string): ResponseDataPromise<ObjectType> =>
  request({
    url: proxy.CHECC_API_CMS + `/kjsl/strengthShow/getTresultTechaward?awardClassId=${classId}&awardGradeId=${gradeId}`,
    method: 'post',
  })

export const slZlRequest = (level: string): ResponseDataPromise<ObjectType> =>
  request({
    url: proxy.CHECC_API_CMS + `/kjsl/strengthShow/getTresultPatent?levelId=${level}`,
    method: 'post',
  })

export const slRzRequest = (level: string): ResponseDataPromise<ObjectType> =>
  request({
    url: proxy.CHECC_API_CMS + `/kjsl/strengthShow/getTresultCopyrights?levelId=${level}`,
    method: 'post',
  })

export const cgResultRequest = (year: string): ResponseDataPromise<ObjectType> =>
  request({
    url: proxy.CHECC_API_CMS + `/kjsl/strengthShow/getAchievement?year=${year}`,
    method: 'post',
  })

export const cgLevelRequest = (classId: string, gradeId: string): ResponseDataPromise<ObjectType> =>
  request({
    url: proxy.CHECC_API_CMS + `/kjsl/strengthShow/getAwardLevel?awardClassId=${classId}&awardGradeId=${gradeId}`,
    method: 'post',
  })

export const cgBlockRequest = (): ResponseDataPromise<ObjectType> =>
  request({
    url: proxy.CHECC_API_CMS + "/kjsl/strengthShow/getBusinessSegment",
    method: 'post',
  })

export const jfOutRequest = (year: string, level: string, type: string): ResponseDataPromise<ObjectType> =>
  request({
    url: proxy.CHECC_API_CMS + `/kjsl/scientificResearchFund/getProjectInput?year=${year}&level=${level}&projectType=${type}`,
    method: 'post',
  })

export const jfRatioRequest = (year: string, level: string, type: string): ResponseDataPromise<ObjectType> =>
  request({
    url: proxy.CHECC_API_CMS + `/kjsl/scientificResearchFund/getCompare?year=${year}&level=${level}&projectType=${type}`,
    method: 'post',
  })

export const jfPieRequest = (year: string, level: string, type: string): ResponseDataPromise<ObjectType> =>
  request({
    url: proxy.CHECC_API_CMS + `/kjsl/scientificResearchFund/getItemProportion?year=${year}&level=${level}&projectType=${type}`,
    method: 'post',
  })

export const jfTypeRequest = (year: string, level: string, type: string): ResponseDataPromise<ObjectType> =>
  request({
    url: proxy.CHECC_API_CMS + `/kjsl/scientificResearchFund/getProportion?year=${year}&level=${level}&projectType=${type}`,
    method: 'post',
  })

export const jfOutPutRequest = (year: string): ResponseDataPromise<ObjectType> =>
  request({
    url: proxy.CHECC_API_CMS + `/kjsl/scientificResearchFund/getExpenditure?year=${year}`,
    method: 'post',
  })

export const jfInputRequest = (year: string): ResponseDataPromise<ObjectType> =>
  request({
    url: proxy.CHECC_API_CMS + `/kjsl/scientificResearchFund/getReceipts?year=${year}`,
    method: 'post',
  })
